import { storage } from 'js/util'

export default {
  state: {
    wideTemp: ([] || storage.get('wideTemp'))
  },
  getters: {
    wideTemp: state => state.wideTemp
  },
  actions: {
    /**
     * 获取 模板名称
     */
    fetchWideTemplate({ state }) {
      const obj = {
        app: [
          {
            value: 'app_hotitems',
            label: '专题'
          },
          {
            value: 'susiness',
            label: 'app店铺'
          },
          {
            value: 'category',
            label: '新品上市'
          },
          {
            value: 'applike',
            label: '猜你喜欢'
          }
        ],
        pc: [
          {
            value: 'adv_more',
            label: '多广告'
          },
          {
            value: 'new_product',
            label: '潮流新款'
          },
          {
            value: 'advinfo',
            label: '长条广告'
          },
          {
            value: 'special',
            label: '专场'
          },
          {
            value: 'designer',
            label: '设计师'
          },
          {
            value: 'you_like',
            label: '猜你喜欢'
          }
        ]
      }
      state.wideTemp = obj
    }
  }
}